package com.chis.jxc;

import com.chis.jmdatatimer.comm.TxMgmtModule;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;

/**
 * 
 * @Description  删除hbase疫苗流转表中的垃圾数据
 * @Company zwx
 * @author wlj
 * @version 2019年08月29日
 */
public class Delbact {
    public static void main(String[] args) throws Exception {
        String path = args[0];
        File file1 = new File(path);
        FileReader m  = new FileReader(file1);
        BufferedReader reader = new BufferedReader(m);
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"spring.xml"});
        context.start();
        TxMgmtModule txMgmtModule = (TxMgmtModule) context.getBean("TxMgmtModule");
        while (true) {
            String nextline  = reader.readLine();
            if (nextline == null) break;
            String[] strings = nextline.split(":");
            txMgmtModule.deltracebact(Long.valueOf(strings[0]),strings[1],strings[2]);
            System.out.println("地区："+strings[0]+"疫苗："+strings[1]+"批号："+strings[2]);
        }
        reader.close();
    }
}
